refactor: remove dependency on boost.tti using detector idiom#531
Conversation
|
Compiler-warning counts vs
|
|
Boost dependency footprint vs Header-inclusion weights (graph files pulling each direct dependency in):
Transitive Boost modules: 69 → 68 (-1)
|
|
Did you mean to add the Boost type_traits dependency? |
|
Yes:
The simplest implementation of the detector idiom has some edge cases ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf )
Boost implementation goes through an auxiliary boost::make_void class in order to solve this issue |
Remove dependency to Boost.TTI. Use void_t detector idiom instead.
Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
Removes Boost.Graph's dependency on Boost.TTI (and the last MPL use in DFS).
depth_first_search.hpp: replaced theBOOST_TTI_HAS_MEMBER_FUNCTION(finish_edge)detector and its__GNUC__/clang/intel#iffork with avoid_texpression-SFINAE detector,has_finish_edge<Vis, E, G>, that checks whethervis.finish_edge(e, g)is a valid call. D#include <boost/tti/has_member_function.hpp><boost/type_traits/make_void.hpp>and<type_traits>.mpl::vector<E, const G&>that only existed to feed TTI's signature, so the file is now MPL-free as well.build.jam: dropped/boost/tti//boost_tti.CMakeLists.txt: droppedBoost::tti.All changes in
boost::detail, detection is identical forvoid finish_edge(Edge, const Graph&)visitors, and the check now works uniformly on C++14 compilers.Motivation
It's not worth pulling a Boost dependency anymore now that the sfinae + detector idiom are available in C++14.
Testing
Checklist
b2in thetest/directory).